package com.base.data.message
{
	import com.base.util.Utils;
	
	import mx.collections.ArrayCollection;

	/**
	 *位置 
	 * @author Administrator
	 * 
	 */	
	public class HouseLocation
	{
		/**
		 *区域位置(所在大区)
		 */		
		[Bindable]
		public static var LocationList:ArrayCollection  = new ArrayCollection(
				[{label:"天元",data:1}
				,{label:"荷塘",data:2}
				,{label:"石峰",data:3}
				,{label:"芦淞",data:4}
				,{label:"醴陵",data:5}
				,{label:"其他",data:6}
			]);
		
		private var _locationArea:uint;
		
		private var _detailLocation:String;
		
		/**
		 * 
		 * @param location
		 * @param detailLocation
		 */		
		public function HouseLocation(  )
		{
			
		}

		/**
		 *详细地址 
		 */
		public function get detailLocation():String
		{
			return _detailLocation;
		}

		/**
		 * @private
		 */
		public function set detailLocation(value:String):void
		{
			_detailLocation = value;
		}

		/**
		 *所在大区,数据见Location.LocationList
		 */
		public function get locationArea():uint
		{
			return _locationArea;
		}

		/**
		 *所在大区,数据见Location.LocationList
		 */
		public function set locationArea( value:uint ):void
		{
			var item:Object = Utils.findDataByArray( LocationList , value );
			if( !item ) {
				throw new Error("请输入正确的区域地址");
				return;
			}
			_locationArea = value;
		}

	}
}